using System;
using System.Collections.Generic;
using System.Text;
using Spring.Data;
using System.Data;
using System.Data.SqlClient;
using Domain.pe.com.workspace;

namespace DAO.pe.com.workspace.oficina.impl.procedure
{
    public class FacturaDetalleRowMapper : IRowMapper
    {
        /// <summary>
        /// Map a row of data to a OrderDetails object.
        /// </summary>
        /// <remarks>This method should not call Next() on the 
        /// DataReader; it should only extract the values of the current row.
        /// </remarks>
        /// <param name="dataReader">The IDataReader to map</param>
        /// <param name="rowNum">the number of the current row.</param>
        /// <returns>A Customer object.</returns>
        public object MapRow(IDataReader dataReader, int rowNum)
        {
            SqlDataReader dr = dataReader as SqlDataReader;
            DetalleFactura detalleFactura = new DetalleFactura();
            detalleFactura.Id = dr.GetInt32(0);
            detalleFactura.IdFactura = dr.GetInt32(1);
            detalleFactura.Cantidad = dr.GetInt32(2);
            detalleFactura.Precion = dr.GetInt32(3);
            return detalleFactura;
        }
    }

}
